<?xml version="1.0" encoding="UTF-8"?>
<!-- 
 Copyright (C) 2014 - Open Source Geospatial Foundation. All rights reserved.
 This code is licensed under the GPL 2.0 license, available at the root
 application directory.
 -->
<!--  <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">-->

<beans xmlns="http://www.springframework.org/schema/beans"  
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
  
  <!-- The URL mangler injecting the authentication key back into the urls 
    generated by GeoServer -->
  <bean id="authKeyMangler" class="org.geoserver.security.AuthenticationKeyMangler" />
           
  <!-- auth key mapping using a authkeys.properties file -->                                  
  <bean id="propertyMapper" class="org.geoserver.security.PropertyAuthenticationKeyMapper"  scope="prototype"/>
  
  <!-- auth key mapping using a user property -->
  <bean id="userPropertyMapper" class="org.geoserver.security.UserPropertyAuthenticationKeyMapper" scope="prototype">
    <property name="userPropertyName" value="UUID"/>
  </bean>
  
  <bean id="webServiceMapper" class="org.geoserver.security.WebServiceAuthenticationKeyMapper" scope="prototype"/>
  
  <bean id="authenticationKeyProvider" class="org.geoserver.security.GeoServerAuthenticationKeyProvider">
      <constructor-arg ref="geoServerSecurityManager"/>
      <constructor-arg name="autoSyncDelaySeconds" value="60"/>
  </bean>
  
  <bean id="authKeyPanelInfo" class="org.geoserver.security.web.AuthenticationKeyFilterPanelInfo">
        <property name="id" value="security.AuthenticationKeyFilter" />
        <property name="shortTitleKey" value="AuthenticationKeyFilterPanel.short"/>
        <property name="titleKey" value="AuthenticationKeyFilterPanel.title"/>
        <property name="descriptionKey" value="AuthenticationKeyFilterPanel.description"/>
   </bean>

  <!-- WebService UserGroup service panel infos -->
  <bean id="authKeyWebServiceBodyResponseSecurityProvider" class="org.geoserver.security.WebServiceBodyResponseSecurityProvider">
    <constructor-arg ref="geoServerSecurityManager"/>
  </bean>
  
  <bean id="authKeyWebServiceBodyResponseUserGroupServicePanelInfo" class="org.geoserver.security.web.WebServiceBodyResponseUserGroupServicePanelInfo">
      <property name="id" value="security.authKeyWebServiceBodyResponseUserGroupService" />
      <property name="shortTitleKey" value="WebServiceBodyResponseUserGroupServicePanel.short"/>
      <property name="titleKey" value="WebServiceBodyResponseUserGroupServicePanel.title"/>
      <property name="descriptionKey" value="WebServiceBodyResponseUserGroupServicePanel.description"/>
  </bean>
  
  <!-- REST based role service panel infos -->
  <bean id="authKeyRESTRoleServicePanelInfo" class="org.geoserver.security.web.GeoServerRestRoleServicePanelInfo">
      <property name="id" value="security.authKeyRESTRoleService" />
      <property name="shortTitleKey" value="GeoServerRestRoleServicePanel.short"/>
      <property name="titleKey" value="GeoServerRestRoleServicePanel.title"/>
      <property name="descriptionKey" value="GeoServerRestRoleServicePanel.description"/>
  </bean>
  
  <bean id="authKeyExtension" class="org.geoserver.platform.ModuleStatusImpl">
    <property name="module" value="gs-authkey" />
    <property name="name" value="Authkey Extension"/>
    <property name="component" value="AuthKey extension"/>
    <property name="available" value="true"/>
    <property name="enabled" value="true"/>
   </bean>

</beans>
